<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>发布帖子-CAS官网</title>
		<link rel="stylesheet" href="css/iconfont.css" />
		<link rel="shortcut icon" href="img/favicon.ico" />
		<link rel="stylesheet" href="css/admin.css" />
		<link rel="stylesheet" href="css/publishpost.css" />
		<script type="text/javascript" src="js/jquery-3.2.0.min.js"></script>
		<script type="text/javascript" src="js/addpost.js"></script>

		<link href="editormd/css/editormd.min.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="editormd/editormd.js"></script>
		<script type="text/javascript">
			var testEditor;

			testEditor = $(function() {
				editormd("test-editormd", {
					width: document.body.clientWidth - 290 < 690 ? 690 : document.body.clientWidth - 290,
					height: document.body.clientHeight - 192,
					//markdown : md,
					codeFold: true,
					syncScrolling: "single",
					//你的lib目录的路径
					path: "editormd/lib/",
					imageUpload: true, //关闭图片上传功能
					imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
					imageUploadURL: "http://localhost:8080/cas/fileUpload.action",
					//theme: "dark",//工具栏主题
					//previewTheme: "dark",//预览主题
					//editorTheme: "pastel-on-dark",//编辑主题 
					emoji: true,
					taskList: true,
					tocm: true, // Using [TOCM]
					tex: true, // 开启科学公式TeX语言支持，默认关闭
					flowChart: true, // 开启流程图支持，默认关闭
					sequenceDiagram: true, // 开启时序/序列图支持，默认关闭,
					//这个配置在simple.html中并没有，但是为了能够提交表单，使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中，方便post提交表单。
					saveHTMLToTextarea: true,
					onresize: function() {
						changeEditorSize();
					},
					onfullscreen: function() {
						$(".g-left,.g-status").fadeOut(0);
						$("#test-editormd").css({
							"left": "20px",
							"top": "20px",
							"border": "1px solid rgb(221,221,221)"
						});
						width = document.body.clientWidth - 60;
						height = document.body.clientHeight - 142;
						fullscreen = true;
						changeEditorSize();
					},
					onfullscreenExit: function() {
						console.log("fullscreenExit");
						$(".g-left,.g-status").fadeIn(0);
						$("#test-editormd").css({
							"left": "0px",
							"top": "0px",
							"border": "1px solid rgb(221,221,221)"
						});
						height = document.body.clientHeight - 122;
						fullscreen = false;
						changeEditorSize();
					},
					onwatch: function() {
						console.log("onwatch");
						onwatch = true;
						changeEditorSize();
					},
					onunwatch: function() {
						console.log("onunwatch");
						onwatch = false;
						changeEditorSize();
					}
				});

			});
		</script>
	</head>

	<body>
		<div class="g-left">
			<ul class="m-nav">
				<li>
					<span><i class="icon iconfont">&#xe63c;</i>个人中心<i class="icon iconfont">&#xe600;</i></span>
					<ul>
						<li>
							<a href="changepassword.html">修改密码</a>
						</li>
					</ul>
				</li>
				<li>
					<span><i class="icon iconfont">&#xe612;</i>用户管理<i class="icon iconfont">&#xe601;</i></span>
					<ul>
						<li>
							<a href="adduser.html">添加用户</a>
						</li>
						<li>
							<a href="userlist.html">用户列表</a>
						</li>
						<li>
							<a href="deleteuser.html">删除用户</a>
						</li>
					</ul>
				</li>
				<li class="m-active">
					<span><i class="icon iconfont">&#xe638;</i>帖子管理<i class="icon iconfont">&#xe601;</i></span>
					<ul>
						<li>
							<a href="addposttype.html">添加帖子分类</a>
						</li>
						<li>
							<a href="posttypelist_admin.html">帖子列表</a>
						</li>
						<li class="m-li-active">
							<a href="publishpost.html">发布帖子</a>
						</li>
						<li>
							<a href="postlist_admin.html">帖子列表</a>
						</li>
						<li>
							<a href="deletepost.html">删除帖子</a>
						</li>
					</ul>
				</li>
				<li>
					<span><i class="icon iconfont">&#xe60d;</i>新闻管理<i class="icon iconfont">&#xe601;</i></span>
					<ul>
						<li>
							<a href="addnews.html">编写新闻</a>
						</li>
						<li>
							<a href="newslist_admin.html">新闻列表</a>
						</li>
						<li>
							<a href="deletenews.html">删除新闻</a>
						</li>
					</ul>
				</li>
				<li><span><i class="icon iconfont">&#xe9a1;</i>照片墙管理<i class="icon iconfont">&#xe601;</i></span>
					<ul>
						<li>
							<a href="addpicture.html">添加照片</a>
						</li>
						<li>
							<a href="picturelist.html">照片列表</a>
						</li>
					</ul>
				</li>
			</ul>
		</div>
		<div class="g-right">
			<div class="g-status">
				<i class="icon iconfont m-switch">&#xe606;</i>
				<div>
					<i class="icon iconfont m-switch">&#xe602;</i>
					<a href="index.html">前台</a>
					<i class="icon iconfont m-switch">&#xe6a0;</i>
					<span>管理员:</span>
					<a href="">张三</a>
					<i class="icon iconfont m-switch">&#xe60e;</i>
					<a href="">安全退出</a>
				</div>
			</div>
			<div class="g-mn">
				<div>
					<form class="m-form-content">
						<!-- editormd start -->
						<div class="editormd" id="test-editormd">
							<textarea class="editormd-markdown-textarea" name="test-editormd-markdown-doc" id="editormd"></textarea>
							<!-- 第二个隐藏文本域，用来构造生成的HTML代码，方便表单POST提交，这里的name可以任意取，后台接受时以这个name键为准 -->
							<!-- html textarea 需要开启配置项 saveHTMLToTextarea == true -->
							<textarea class="editormd-html-textarea" name="editorhtml" id="editorhtml"></textarea>
						</div>
						<!-- editormd end -->
						<div class="m-input">
							<input type="input" name="title" placeholder="请输入文章标题" />
							<select name="posttype">
								<option value="JAVA">JAVA</option>
								<option value="C++">C++</option>
								<option value="C语言">C语言</option>
								<option value="JAVAEE">JAVAEE</option>
							</select>
							<input type="submit" value="保存" />
						</div>
					</form>
				</div>
			</div>
	</body>

</html>